package cn.wolfcode.transfer.domain;

import cn.hutool.core.util.ArrayUtil;

import java.util.List;

public class Question {
    /** */
    private Long id;

    /** 标题*/
    private String title;

    /** 类型(单选/多选/判断)*/
    private Integer type;

    /** 判断正确(针对判断题才有此项)*/
    private Boolean judgeRight;
    //正确答案
    private List<QuestionItem> answers;
    //全部答案
    private List<QuestionItem> questionAll;

    //正确答案对象字符串



    public void setAnswers(List<QuestionItem> answers) {
        this.answers = answers;
    }

    public List<QuestionItem> getQuestionAll() {
        return questionAll;
    }

    public void setQuestionAll(List<QuestionItem> questionAll) {
        this.questionAll = questionAll;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getJudgeRight() {
        return judgeRight;
    }

    public void setJudgeRight(Boolean judgeRight) {
        this.judgeRight = judgeRight;
    }
    public String getAnswers(){
        String str="";
        for (QuestionItem questionItem : this.answers) {
             String s  = questionItem.getTitle().substring(0,1);
            str += s ;
        }
        System.out.println(str);
        return str;
    }

}